/**
 *
 * User: rendong
 * Date: 12-9-6
 * Time: 下午10:50
 * $Id: GImage.js 11 2012-09-06 15:55:53Z rendong237@gmail.com $
 */


function GImage(){

}

GImage.prototype.finish = false;
GImage.prototype.image = null;
GImage.prototype.width = 0;
GImage.prototype.height = 0;

GImage.prototype.loadImage = function(url, finishCallback)
{
    this.image = new Image();

    var self = this;
    this.image.addEventListener("load", function (){
        self.finish = true;
        self.width = self.image.width;
        self.height = self.image.height;

        if (typeof finishCallback == 'function'){
            finishCallback();
        }
    }, false);

    this.image.src = url;
}